﻿using Prism.Events;
using StarryEdge.Core.Manager;
using StarryEdge.WPF.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Loader;
using System.Text;
using System.Threading.Tasks;

namespace StarryEdge.Domains
{
    public class MenuUpdate : StarryEdge.Core.IMenuUpdate
    {
        private IObjectManager _objectManager;
        private IEventAggregator _aggregator;
        private ITaskManager _taskManager;
        public MenuUpdate(IObjectManager objectManager, ITaskManager taskManager, IEventAggregator aggregator)
        {
            _objectManager = objectManager;
            _aggregator = aggregator;
            _taskManager = taskManager;
        }

        public bool UpdateHandle()
        {
            return _taskManager.Update();
        }

        public bool UpdateMenu()
        {
            _aggregator.GetEvent<MessageEvent>().Publish(new MessageEventModel()
            {
                Code = 230,

            });
            return true;
        }

        public bool UpdateParameter(int type)
        {
            return _objectManager.Update(type);
        }
    }
}
